# Maintainer: Alexander F. Rødseth <xyproto@archlinux.org>
# Contributor: Paulo Matias <matiasΘarchlinux-br·org>
# Contributor: Daniel J Griffiths <ghost1227@archlinux.us>

pkgname=libnsbmp
pkgver=0.1.6
pkgrel=8
pkgdesc='Decoding library for BMP and ICO image file formats'
arch=(loong64 x86_64)
url='https://www.netsurf-browser.org/projects/libnsbmp/'
license=(MIT)
makedepends=('netsurf-buildsystem>=1.9')
source=("https://download.netsurf-browser.org/libs/releases/$pkgname-$pkgver-src.tar.gz")
b2sums=('546f26c0ebbc2b93aec3002424c8e6d5aaeaa06f06fea13712675dd33c71b431c7f6d296c55a4d091cba7c9d5eaf053960b3d7e16e24b0832e42f8f4881f675d')

build() {
  CFLAGS+=' -ffat-lto-objects'
  make -C $pkgname-$pkgver \
    COMPONENT_TYPE=lib-shared \
    INCLUDEDIR=include \
    LIBDIR=lib \
    PREFIX=/usr
}

package() {
  cd $pkgname-$pkgver
  CFLAGS+=' -ffat-lto-objects'
  make \
    COMPONENT_TYPE=lib-shared \
    DESTDIR="$pkgdir" \
    INCLUDEDIR=include \
    LIBDIR=lib \
    PREFIX=/usr \
    install
  install -Dm644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
}
